Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(native-filters): apply default value correctly when it's set #17982

Merged
merged 1 commit into from
Jan 10, 2022

Conversation

kgabryje
Copy link
Member

@kgabryje kgabryje commented Jan 10, 2022

SUMMARY

Due to a mistake in passing arguments to dataMask/reducer/fillNativeFilters function (we were passing undefined variable instead of data mask), default value wasn't applied correctly to native filters. This PR fixes this issue.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

Before: see linked issue
After:

Screen.Recording.2022-01-10.at.13.30.50.mov

TESTING INSTRUCTIONS

Follow the repro steps from linked issue

ADDITIONAL INFORMATION

CC @jinghua-qa @rosemarie-chiu @rusackas

https://app.shortcut.com/preset/story/34609/native-filter-filter-has-default-value-isn-t-applied-and-visible-after-save

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - also wondering if there is another instance of this bug a few lines above?

@@ -139,8 +139,6 @@ const dataMaskReducer = produce(
action.filterConfig ?? [],
cleanState,
draft,
// @ts-ignore
action.data.dataMask,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have the same issue on line 134?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, in line 134 action object does have data.dataMask field.

@codecov
Copy link

codecov bot commented Jan 10, 2022

Codecov Report

Merging #17982 (da35c59) into master (c0a7695) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #17982   +/-   ##
=======================================
  Coverage   67.08%   67.08%           
=======================================
  Files        1611     1611           
  Lines       64919    64919           
  Branches     6871     6871           
=======================================
+ Hits        43548    43550    +2     
+ Misses      19504    19499    -5     
- Partials     1867     1870    +3     
Flag Coverage Δ
javascript 53.78% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset-frontend/src/dataMask/reducer.ts 60.00% <0.00%> (+10.00%) ⬆️
...et-frontend/src/dashboard/actions/nativeFilters.ts 44.31% <0.00%> (-2.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0a7695...da35c59. Read the comment docs.

Copy link
Member

@villebro villebro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks; LGTM!

@geido
Copy link
Member

geido commented Jan 10, 2022

/testenv up

@github-actions
Copy link
Contributor

@geido Ephemeral environment spinning up at http://35.161.196.81:8080. Credentials are admin/admin. Please allow several minutes for bootstrapping and startup.

Copy link
Member

@geido geido left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the fix

Copy link
Member

@jinghua-qa jinghua-qa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kgabryje kgabryje merged commit 35f4c33 into apache:master Jan 10, 2022
@github-actions
Copy link
Contributor

Ephemeral environment shutdown and build artifacts deleted.

rosemarie-chiu pushed a commit to preset-io/superset that referenced this pull request Jan 10, 2022
@rosemarie-chiu
Copy link
Contributor

🏷 2022.1

shcoderAlex pushed a commit to casual-precision/superset that referenced this pull request Feb 7, 2022
bwang221 pushed a commit to casual-precision/superset that referenced this pull request Feb 10, 2022
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.5.0 labels Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2022.1 size/XS v1.4.1 🚢 1.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[native filter] "Filter has default value" isn't applied and visible after save
7 participants